<!--{eval $_TPL['titles'] = array('产品上传');}-->
<!--{eval $_TPL["js"] = array ("swfupload/jquery-1.3.2.min.js","swfupload/swfupload.js","swfupload/handlers.js");}-->
<!--{template header}-->
<!--{if $_GET[op] == 'delete'}-->

<h1>删除产品</h1>
<a href="javascript:hideMenu();" class="float_del" title="关闭">关闭</a>
<div class="popupmenu_inner">
<form method="post" action="cp.php?ac=product&op=delete&picid=$picid">
	<p>确定删除指定的产品吗？</p>
	<p class="btn_line">
		<input type="hidden" name="refer" value="$_SGLOBAL[refer]" />
		<input type="hidden" name="deletesubmit" value="true" />
		<input type="submit" name="btnsubmit" value="确定" class="submit" />
	</p>
<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
</form>
</div>

<!--{else}-->

<style type="text/css">
<!--
    #pic_wrapper{
    	border:0 none;
    	width:500px;
    }
-->
</style>
<script type="text/javascript">
<!--
var swfu = null;
function swfuInit() {
	swfu = new SWFUpload({
				// Backend Settings
				upload_url : "upload.php",
				post_params : {"op":"upload","temp_dir":"{$temp_dir}","type":"big"},
				file_post_name : "Filedata",	
				// File Upload Settings
				file_size_limit : "1000", // 2MB
				file_types : "*.jpg; *.gif; *.png;",
				file_types_description : "选择 JPEG/PNG/gif 格式文件",
				file_upload_limit : "100",
				file_queue_limit:"1",
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadSuccess,
				upload_complete_handler : uploadComplete,
				upload_start_handler:uploadStart,
				button_image_url : "swfupload/images/SmallSpyGlassWithTransperancy_17x18.png",
				button_placeholder_id : "spanButtonPlaceholder",
				button_width : 280,
				button_height : 18,
				button_text : '<span color="#fff" class="button">图片上传(最大为 800KB)</span>',
				button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; } .buttonSmall { font-size: 12pt;color:#ffffff; }',
				button_text_top_padding : 0,
				button_text_left_padding : 22,
				button_window_mode : SWFUpload.WINDOW_MODE.TRANSPARENT,
				button_cursor : SWFUpload.CURSOR.HAND,

				// Flash Settings
				flash_url : "swfupload/swfupload.swf",

				custom_settings : {
					upload_target : "divFileProgressContainer"
				},

				// Debug Settings
				debug : false
			});
			
	swfu_small = new SWFUpload({
				// Backend Settings
				upload_url : "upload.php",
				post_params : {"op":"upload","temp_dir":"{$temp_dir}","type":"thumb"},
				file_post_name : "Filedata",	
				// File Upload Settings
				file_size_limit : "1000", // 2MB
				file_types : "*.jpg; *.gif; *.png;",
				file_types_description : "选择 JPEG/PNG/gif 格式文件",
				file_upload_limit : "100",
				file_queue_limit:"1",
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadSuccess_thumb,
				upload_complete_handler : uploadComplete,
				upload_start_handler:uploadStart,
				button_image_url : "swfupload/images/SmallSpyGlassWithTransperancy_17x18.png",
				button_placeholder_id : "spanButtonPlaceholder1",
				button_width : 280,
				button_height : 18,
				button_text : '<span color="#fff" class="button">图片上传(最大为 800KB)</span>',
				button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; } .buttonSmall { font-size: 12pt;color:#ffffff; }',
				button_text_top_padding : 0,
				button_text_left_padding : 22,
				button_window_mode : SWFUpload.WINDOW_MODE.TRANSPARENT,
				button_cursor : SWFUpload.CURSOR.HAND,

				// Flash Settings
				flash_url : "swfupload/swfupload.swf",

				custom_settings : {
					upload_target : "divFileProgressContainer1"
				},

				// Debug Settings
				debug : false
			});
};

jQuery(function() {
	swfuInit();
	
});
function check(){
	var name = jQuery("#name").val();
	var filename = jQuery("#filename").val();
	var title = jQuery("#title").val();
	
	if(jQuery.trim(name)==''){
		alert("请填写产品名称");
		return false;
	}
	if(jQuery.trim(filename)==''){
		alert("请上传图片");
		return false;
	}
	if(jQuery.trim(title)==''){
		alert("请上填写说明");
		return false;
	}
	return true;
}
//-->
</script>

<div class="tabs_header">
	<ul class="tabs">
		<li class="active">
		  <a href="cp.php?ac=product"><span>产品图片上传</span></a>
		</li>
					<li><a href="space.php?do=product"><span>返回产品列表</span></a></li>
	</ul>
</div>
<div class="c_form">

	<form id="my_form"   enctype="multipart/form-data" action="cp.php?ac=product" method="post" style="display:none;">
		<div class="block style4">
			
			<table cellspacing="3" cellpadding="3">
				<tbody>
					<tr>
						<th>文件上传</th>
						<td colspan="1"><input type="file" value="" name="Filedata"></td>
						
					</tr>					
					
					<tr>
						<th>&nbsp;</th>
						<td>
							<input type="hidden" value="upload" name="op">
							<input type="hidden" value="$temp_dir" name="temp_dir">
							<input type="submit" class="submit" value="提交">
						</td>
					</tr>
				</tbody>
			</table>
			
		</div>

	</form>
	<form   enctype="multipart/form-data" action="upload.php" method="post" style="display:none;">
		<div class="block style4">
			
			<table cellspacing="3" cellpadding="3">
				<tbody>
					<tr>
						<th>文件上传</th>
						<td colspan="1"><input type="file" value="" name="Filedata"></td>
						
					</tr>					
					
					<tr>
						<th>&nbsp;</th>
						<td>
							<input type="hidden" value="upload" name="op">
							<input type="submit" class="submit" value="提交">
						</td>
					</tr>
				</tbody>
			</table>
			
		</div>

	</form>
		
	<table  cellspacing='4' cellpadding='4' width='100%' class='infotable'>	
		
		
	</table>
	
	<form id="my_form1"   enctype="multipart/form-data" action="cp.php?ac=product&picid=$pic[picid]" method="post" style="">
		<div class="block style4">
			
			<table cellspacing="3" cellpadding="3">
				<tbody>
					<tr>
						<th>
							图片上传
						</th>
						<td>
							<div style="background-color:#ccc;width:220px;color:#fff;margin-bottom:5px;">		
								<span  id="spanButtonPlaceholder"></span>
							</div>
							&nbsp;&nbsp;请选择需要上传的图片。
						</td>
					</tr>
					<tr style="display:none;">
						<th >
							&nbsp;
						</th>
						<td>			
							<div id="divFileProgressContainer">								
							</div>	
						</td>
					</tr>
					<tr>
						<th>图片预览</th>
						<td>
							<div id="pic_wrapper">
							<!--{if $pic}-->
							<img src="$pic[filepath]"/>
							<!--{/if}-->
							</div>
						</td>
						
					</tr>	
					
					<tr>
						<th>
							小图上传
						</th>
						<td>
							<div style="background-color:#ccc;width:220px;color:#fff;margin-bottom:5px;">		
								<span  id="spanButtonPlaceholder1"></span>
							</div>
							&nbsp;&nbsp;请选择需要上传的图片。
						</td>
					</tr>
					<tr style="display:none;">
						<th >
							&nbsp;
						</th>
						<td>			
							<div id="divFileProgressContainer1">								
							</div>	
						</td>
					</tr>
					<tr>
						<th>小图预览</th>
						<td>
							<div id="pic_wrapper1">
							<!--{if $pic}-->
							<img src="$pic[thumbpath]"/>
							<!--{/if}-->
							</div>
						</td>
						
					</tr>	
					<tr>
						<th>产品名称</th>
						<td>
							<input type="text"   size="40" value="$pic[name]" name="name" id="name" class="t_input">
						</td>
						
					</tr>					
					
					<tr>
						<th>归类</th>
						<td>
							<select name="cat">
							<!--{loop $category $k $v}-->
								<option value="$k"  <!--{if $pic[cat]==$k}-->selected<!--{/if}-->>$v[name]</option>
									<!--{loop $v[subcat] $k1 $v1}-->
									<option value="$k,$k1" <!--{if $pic[subcat]==$k1}-->selected<!--{/if}-->>			
										---$v1[name]
									</option>
									
									<!--{/loop}-->
								<!--{/loop}-->
							</select>
						</td>
						
					</tr>					
					
					<tr>
						<th>说明</th>
						<td >
							<textarea name="title" style="width:400px;height:60px;overflow:auto;" id="title">$pic[title]</textarea>
						</td>
						
					</tr>					
					
					<tr>
						<th>&nbsp;</th>
						<td>
							<input type="hidden" value="$pic[filename]" name="filename" id="filename">
							<input type="hidden" value="$pic[filepath]" name="file" id="file">
							<input type="hidden" value="<!--{eval echo str_replace('swfupload/product/','',$pic[thumbpath])}-->" name="thumb" id="thumb">
							<input type="hidden" value="move" name="op">
							<input type="submit" class="submit" value="提交" onclick="return check();">
						</td>
					</tr>
				</tbody>
			</table>
			
		</div>

	</form>
		
</div>
<!--{/if}-->
	
<!--{template footer}-->